package com.cuixichang.minimalism.transfer.dto;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.springframework.util.Assert;
import com.cuixichang.minimalism.basal.core.BaseDTO;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
/**
 * 对象实体
 *
 * @author cuixichang
 * @date 2024-12-18
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
public class IFormPlugDTO extends BaseDTO{
   /**
    * 组件绑定ID
    */
    @JsonSerialize(using= ToStringSerializer.class)
    private Long formId;
   /**
    * 适用组件类型
    */
    private String fieldType;
   /**
    * 使用模块名
    */
    private String moduleName;
   /**
    * 插件名称
    */
    private String plugName;
   /**
    * 系统编码
    */
    private String createSystemCode;

    @Override
    public void check() {
        Assert.notNull(formId,"组件绑定ID不能为空");
        Assert.hasText(fieldType,"适用组件类型不能为空");
        Assert.hasText(moduleName,"使用模块名不能为空");
        Assert.hasText(plugName,"插件名称不能为空");
        Assert.hasText(createSystemCode,"系统编码不能为空");
    }
}
